<html>
<head><meta charset="utf-8"><title>future-incompat-report implementation · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html">future-incompat-report implementation</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="215006313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215006313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215006313">(Oct 29 2020 at 18:09)</a>:</h4>
<p>Now that the rustc implementation of <code>cargo report-future-incompat</code> is in the bors queue (<a href="https://github.com/rust-lang/rust/pull/75534">https://github.com/rust-lang/rust/pull/75534</a>), I'm starting to work on the Cargo implementation.</p>
<p>Looking over the Cargo code, it looks like this will require us to collect <code>FutureIncompatReport</code> JSON messages from each job <code>on_stderr_line_inner</code>, and then aggregate them somehow.</p>
<p>These messages can be produced from both <code>cargo build</code> and <code>cargo check</code>, so I don't think we'll want the aggregation to rely on getting the captured output from the build graph. This would mean performing some kind of top-level output caching - as far as I can tell, cargo currently only caches output on a per-job basis</p>



<a name="215006389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215006389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215006389">(Oct 29 2020 at 18:09)</a>:</h4>
<p>Does that sound correct? If so, where would we want to store this top-level (per workspace?) cache on disk?</p>



<a name="215006456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215006456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215006456">(Oct 29 2020 at 18:10)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="116083">@pnkfelix</span></p>



<a name="215007078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215007078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215007078">(Oct 29 2020 at 18:14)</a>:</h4>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> I haven't looked at the current implementation (of <code>report-future-incompat</code>)<br>
 too closely, but I don't think it will require a separate caching mechanism.  All JSON messages for each Unit are already saved to disk.  The <code>JobQueue</code> can aggregate all the warnings, and report them at the end.  In <code>on_stderr_line_inner</code>, it will just need to detect those JSON messages, and send a <code>Message</code> to the <code>JobQueue</code> (you'll probably need to add a new <code>Message</code> variant).  The messages are automatically replayed from the cache, so I don't think there will need to be any additional work to support that.</p>



<a name="215012046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215012046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215012046">(Oct 29 2020 at 18:54)</a>:</h4>
<p>How will that interact with a <code>cargo report-future-incompatible</code> command?</p>



<a name="215013866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215013866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215013866">(Oct 29 2020 at 19:08)</a>:</h4>
<p>Wouldn't we need to construct a <code>JobQueue</code> by either doing the equivalent of <code>cargo build</code> or <code>cargo check</code>?</p>



<a name="215018223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215018223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215018223">(Oct 29 2020 at 19:45)</a>:</h4>
<p>Oh, i forgot there is that separate report. I would still probably follow the above, and then have <code>JobQueue</code> save the report somewhere in a JSON format. Probably needs to go in the root of the target directory (similar to <code>target/.rustc_info.json</code>). Let me know if you have any questions on how to do that.</p>



<a name="215027147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215027147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215027147">(Oct 29 2020 at 21:00)</a>:</h4>
<p>When you Ctrl-C cargo after a job has failed, but before cargo has finished executing the others, does it attempt to do a graceful shutdown?</p>



<a name="215027189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215027189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215027189">(Oct 29 2020 at 21:00)</a>:</h4>
<p>My thought is that it might be useful to write out a partial future-incompat-report for the crates that did finish</p>



<a name="215027198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215027198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215027198">(Oct 29 2020 at 21:00)</a>:</h4>
<p>No, Ctrl-C kills all rustc processes.</p>



<a name="215027235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215027235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215027235">(Oct 29 2020 at 21:01)</a>:</h4>
<p>does cargo itself handle the control-c in any way?</p>



<a name="215027254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215027254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215027254">(Oct 29 2020 at 21:01)</a>:</h4>
<p>Or rather it kills all processes in the foreground job.</p>



<a name="215027286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215027286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215027286">(Oct 29 2020 at 21:01)</a>:</h4>
<p>I don't think cargo handles Ctrl-C at all.</p>



<a name="215027762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215027762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215027762">(Oct 29 2020 at 21:05)</a>:</h4>
<p>For Windows it has some code to ensure that Ctrl-C kills all rustc processes in addition to the cargo process by creating a job object: <a href="https://github.com/rust-lang/cargo/blob/442de291ca040cf894a1845e6be62f4c081f7b29/src/cargo/util/job.rs">https://github.com/rust-lang/cargo/blob/442de291ca040cf894a1845e6be62f4c081f7b29/src/cargo/util/job.rs</a></p>



<a name="215027812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215027812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215027812">(Oct 29 2020 at 21:05)</a>:</h4>
<p>I would just stream the events into the cache file (save them as they appear), instead of waiting till the end.</p>



<a name="215027937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215027937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215027937">(Oct 29 2020 at 21:06)</a>:</h4>
<p>sounds good</p>



<a name="215027983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215027983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215027983">(Oct 29 2020 at 21:06)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span> I think the file will need to go alongside <code>.fingerprint</code>, since we might have different warnings in debug vs release mode</p>



<a name="215027995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215027995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215027995">(Oct 29 2020 at 21:06)</a>:</h4>
<p>e.g. a <code>#[cfg(debug_assertions)]</code> function</p>



<a name="215028235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215028235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215028235">(Oct 29 2020 at 21:08)</a>:</h4>
<p>Also, streaming them directly to the file will result in a nondeterministic order</p>



<a name="215028279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215028279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215028279">(Oct 29 2020 at 21:09)</a>:</h4>
<p>I guess we could just sort it before displaying, since we only display it in response to a command</p>



<a name="215028324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215028324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215028324">(Oct 29 2020 at 21:09)</a>:</h4>
<p>Hm, but then <code>cargo report-future-incompat</code> would need to know which profile was used during the last command (or the user would need to pass in the correct profile).</p>



<a name="215028420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215028420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215028420">(Oct 29 2020 at 21:09)</a>:</h4>
<p>I assume that command would just "print whatever happened during the last command".</p>



<a name="215028542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215028542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215028542">(Oct 29 2020 at 21:10)</a>:</h4>
<p>Sorting sounds reasonable.</p>



<a name="215028837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215028837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215028837">(Oct 29 2020 at 21:13)</a>:</h4>
<p>oh, I see</p>



<a name="215028868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/future-incompat-report%20implementation/near/215028868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/future-incompat-report.20implementation.html#215028868">(Oct 29 2020 at 21:13)</a>:</h4>
<p>using the top-level directory should be fine, then</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>